#####################################################################
# This file installs the required R-packages 
# It should be run once before running the other scripts
# Code to check whether packages are already installed 
# are based on Google's AI answer
#####################################################################


if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
devtools::install_github("synth-inference/synthdid@70c1ce3")
if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}
remotes::install_github("kwuthrich/scinference@v1.0.0")
if (!requireNamespace("limSolve", quietly = TRUE)) {
  install.packages("limSolve")
}
if (!requireNamespace("xtable", quietly = TRUE)) {
  install.packages("xtable")
}
if (!requireNamespace("foreign", quietly = TRUE)) {
  install.packages("foreign")
}
if (!requireNamespace("pracma", quietly = TRUE)) {
  install.packages("pracma")
}
if (!requireNamespace("sandwich", quietly = TRUE)) {
  install.packages("sandwich")
}
if (!requireNamespace("writexl", quietly = TRUE)) {
  install.packages("writexl")
}
